<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="description" content="Svg资源库"/>
    <title>Svg资源库 </title>
    <meta content="always" name="referrer">
    <meta name="keywords" content="Svg资源库，红微科技，RSD框架，Redjs框架">
    <link rel="icon" href="//www.redjs.cn/resources/svg/rsd_red.svg"> 
    <link rel="shortcut icon" href="//www.redjs.cn/resources/svg/rsd_red.svg" type="image/x-icon" />
    <script type="text/javascript" src="../Rsd.js?t=2021090106"></script>
    <!--<script type="text/javascript" src="//js.redmicro.cn/Rsd-all.js?t=2021112701"></script>-->
    <!--script type="text/javascript" src="http://www.redjs.cn/tool/LogWatcher.js?t=2019022001" appId="{{=appId}}"  appAuth="{{=appAuth}}"></script--> 
    <link rel="stylesheet" type="text/css" href="../resources/css/Rsd.css"/>
    <link rel="stylesheet" type="text/css" href="../resources/css/Blue.css"/>
</head>
<body style="display: flex !important;justify-content:space-evenly;">
<script type="text/javascript" lang="zh-cn" language="javascript">

    Rsd.createApplication({
        appTitle: 'Svg资源库',
        appName: 'Rsd.about',
        appFolder: 'src',
        appHost:'',
        loginUrl: 'login',
        indexUrl: 'index.html',
        isDebug:false,
        isDemo:false,
        requires: ['Rsd.form.Label','Rsd.form.Link','Rsd.control.Svg'],
        appId:'b110c126-f428-489f-82fe-a8fcd12ba99a',
        appDate:new Date().getTime(),
        beforeRun:function beforeRun() {

        },
        /*
        * */
        launch: function launch() {

             Rsd.create('Rsd.container.Page', { 
                header:{
                    xtype:'container',
                    height:100,
                    width:'100%',
                    layout:'hbox', 
                    "style":{"left":'20px',"float":'left',"lineHeight":'30px',boxShadow:'1px 2px 1px 1px silver'},
                    items:[
                        {xtype:'link',text:'default',name:'default',width:80,handler:'load_group'},
                        {xtype:'link',text:'home',name:'home',width:60,handler:'load_group'},
                        {xtype:'link',text:'cart',name:'cart',width:60,handler:'load_group'},
                        {xtype:'link',text:'contact',name:'contact',width:90,handler:'load_group'},
                        {xtype:'link',text:'crown',name:'crown',width:75,handler:'load_group'},
                        {xtype:'link',text:'member',name:'member',width:75,handler:'load_group'},
                        {xtype:'link',text:'order',name:'order',width:75,handler:'load_group'},
                        {xtype:'link',text:'goods',name:'goods',width:75,handler:'load_group'},
                        {xtype:'link',text:'buy',name:'buy',width:45,handler:'load_group'},
                        {xtype:'link',text:'find',name:'find',width:60,handler:'load_group'},
                        {xtype:'link',text:'merchant',name:'merchant',width:90,handler:'load_group'},
                        {xtype:'link',text:'message',name:'message',width:90,handler:'load_group'},
                        {xtype:'link',text:'note',name:'note',width:60,handler:'load_group'},
                        {xtype:'link',text:'sale',name:'sale',width:60,handler:'load_group'},
                        {xtype:'link',text:'service',name:'service',width:90,handler:'load_group'},
                        {xtype:'link',text:'bank',name:'bank',width:60,handler:'load_group'},
                        {xtype:'link',text:'setting',name:'setting',width:90,handler:'load_group'},
                        {xtype:'link',text:'print',name:'print',width:60,handler:'load_group'},
                        {xtype:'link',text:'api',name:'api',width:45,handler:'load_group'},
                        {xtype:'link',text:'model',name:'model',width:75,handler:'load_group'},
                        {xtype:'link',text:'menu',name:'menu',width:60,handler:'load_group'},
                        {xtype:'link',text:'not',name:'not',width:60,handler:'load_group'},
                        {xtype:'link',text:'web',name:'web',width:60,handler:'load_group'},
                        {xtype:'link',text:'sort',name:'sort',width:60,handler:'load_group'}
                        ],
                    visible:true
                },
                layout:'fit',
                items:[],
                style:{element:'body',color:'#464646d9',overflow:'auto'},
                /**
                 */
                load_group:function load_group()
                {
                    //console.log(arguments);
                    this.load(arguments[0].name,true);
                },

                /*
                * */
                load:function load(group,click) {

                    var me = this;
                    if(me.isLoaded && click != true)
                    {
                        return;
                    }
                    Rsd.showWaiting(me.id);

                    me.removeAll();
                    me.isLoaded = true;
                    var _group = group||"default";
                    var _url = Rsd.getRedjsUrl('/app/resources/svgLib/' + _group + '.js') ;
                    var _rs_svg = Rsd.create('Rsd.data.SvgLoader',{});

                    _rs_svg.load(_group,_url,function (data) {
                        me.nameList=[];

                        for(var i in data)
                        {
                            me.nameList.push(_group +'.'+i);
                        }

                        var _i = 0;
                        for(var i in me.nameList)
                        {
                            setTimeout(function () {

                                var svg = {
                                    xtype:'svg',
                                    width:'100px',
                                    height:'100px',
                                    margin:'10 20 10 10',
                                    labelTagName:'a',
                                    label:{
                                        width:40,
                                        height:25,
                                        content:me.nameList[_i],
                                        position:'bottom',
                                        style:{cursor: 'pointer'}
                                    },
                                    dsTagName:me.nameList[_i]
                                };
                                
                                //var _t = Rsd.widget(svg);//console.log(_t);
                                var _t = me.add(svg);//console.log(_t);
                                _t.label.element.setAttribute('tagName',me.nameList[_i]);
                                _t.label.element.setAttribute('href','javascript:void(0)');
                                //复制
                                _t.label.element.onclick = function()
                                {
                                    var _data = _rs_svg.get.apply(_rs_svg,this.getAttribute('tagName').split('.'));

                                    Rsd.copy(Rsd.toString(_data));
                                }
                                _i++;

                                if(_i==me.nameList.length||_i > me.nameList.length)
                                {
                                    Rsd.closeWaiting(me.id);
                                }

                            },10*i);


                        }
                        setTimeout(function () {
                            me.doLayout();
                        },10*i);
                    
                    });


                }
           
            }).show();
                    
        }

    });


</script>
</body>
</html>